home *** CD-ROM | disk | FTP | other *** search
- program Kill;
-
- uses
- SysUtils,
- WinProcs,
- WinTypes,
- Messages,
- ToolHelp;
-
- {$R *.RES}
-
- function EnumProc(AHandle: HWND; lParam: Longint): Bool; export;
- begin
- PostMessage (AHandle, WM_CLOSE, 0, 0);
- Result := True;
- end;
-
- {Variables Globales}
- var
- AcApp : array [0..255] of Char;
- hExe : THandle;
- pTask : TTaskEntry;
- bTask : Bool;
-
- {Main Proc}
- begin
- if ParamCount = 0 then
- Exit;
- if ParamCount = 1 then
- StrPCopy (AcApp, ParamStr (1));
- pTask.dwSize := SizeOf (pTask);
- hExe := GetModuleHandle (AcApp);
- bTask := TaskFirst (@pTask);
- while bTask do
- begin
- if pTask.hModule = hExe then
- {PostAppMessage (pTask.hTask, WM_QUIT , 0 ,0);}
- EnumTaskWindows(pTask.hTask, @EnumProc, 0);
- bTask := TaskNext (@pTask);
- end;
- end.
-
-